GPU Programming Assignment
Matthew Dickinson - p1708355

===========
**NOTE**: 
===========

Shaders are loaded using the Shader class found on the learnopengl.com online tutorials.
Shader class source: https://learnopengl.com/Getting-started/Shaders

Objects are loaded to the scene using the Mesh and Model classes found in OBJ_Import.h.
These classes have been taken and cut down to what is needed to load OBJ meshes from files. 

Mesh-Model source: https://learnopengl.com/Model-Loading/Assimp chapter.
Uses the third-party asset importer library, assimp: http://assimp.org/index.php/downloads

===========
CONTROLS:
===========

Camera : WASD keys
Light Position : Arrow keys (X,Z axis), PAGE_UP/PAGE_DOWN (Y axis)
Animation enable/disable : SPACE bar

Toggle post-process effects: TAB key

MODE 0 : Full colour
MODE 1 : Greyscale
MODE 2 : Greyscale + Sobel edges
MODE 3 : Full colour + Sobel edges
MODE 4 : Sobel edges only

==================
REQUIREMENTS MET:
==================
======================================
Importing mesh objects to a 3D scene
======================================

The program uses the above mentioned Mesh and Model classes that utilise the Assimp importer library.
The program successfully loads a total of 6 mesh objects into the scene.

======================================
Render using blinn-phong illumination
======================================

The scene is rendered on the first pass using the blinn-phong illumination model. The shader program is found in the blinnPhong.vert and blinnPhong.frag files.

A light source can be moved arounf the scene using the arrow keys for X,Z movement and the PAGE_UP and PAGE_DOWN keys for Y axis movement.

Specular highlights can be seen as the lightsource is moved closer the ground / objects.

==========================
Edge detection algorithm
==========================

Image processing has been implemented in the edge.vert and edge.frag shader files.
The implemented edge detection algorithm uses the Sobel-Feldman operator.

sources: http://homepages.inf.ed.ac.uk/rbf/HIPR2/sobel.htm
	 https://www.tutorialspoint.com/dip/sobel_operator.htm

========================================================
Enhance the original colour image using post processing
========================================================

Any fragments with a color value lower than (0, 0, 0) must be a detected edge because the calculated gradient magnitude is subtracted from the greyscale texture.

Therefore any fragments that are edges have their alpha value set to 1.0 and non-edges have their alpha value set to 0.

With alpha blending enabled, this allows the edges to be rendered on top of the original scene.

============================
Animation within the scene
============================

The scene is animated by using the glm::rotate() and glm::translate() functions from the GLM maths library. A linear interpolation function has been written to allow back and forth movement of an object to better display the edge detection.

Objects have been placed in the scene to better display the edge detection algorithm.
 
Two torus objects have been placed intersecting the ground plane and rotate to show movement of the rendered edges at intersection with the ground.

Two cubes are placed in the center of the scene rotating in opposite directions with one cube moving back and forth through the other cube using linear interpolation between its start and end positions.
The intersection of the cubes produces multiple edges.

============================
User functionality
============================

The post processing effects can be toggled by pressing the TAB key to move through each effect.
The effects are as follows: 

MODE 0 : Full colour
MODE 1 : Greyscale
MODE 2 : Greyscale + Sobel edges
MODE 3 : Full colour + Sobel edges
MODE 4 : Sobel edges only


The user is also able to:
...enable and disable animation in the scene by pressing the SPACE bar.
...control the camera using WASD keys.
...control the light source position by using the arrow keys and the PAGE_UP and PAGE_DOWN keys.





